package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmChannelDto;
import com.heima.wemedia.service.WmChannelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/api/v1/channel")
public class WmchannelController {
    @Autowired
    private WmChannelService channelService;

    @GetMapping("channels")
    public ResponseResult find() {
        return channelService.findChannelALl();
    }

    @PostMapping("/list")
    public  ResponseResult list(@RequestBody WmChannelDto dto){
         return  channelService.listWithPage(dto);

    }
}
